package com.luxx.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by luxx on 2018/1/9 0009.
 */
@Component
public class DailyTask {
    @Scheduled(cron = "1 * * * * ? *")
    public void task(){
        System.out.println("------------------------------------");
        System.out.println("任务开始了");
        System.out.println("------------------------------------");
    }
    @Scheduled(cron = "*/5 * * * * ?")
    public void task2(){
        System.out.println("------------------------------------");
        System.out.println("任务开始了2");
        System.out.println("------------------------------------");
    }
}
